package com.designpatterns.businessdelegatepattern;

// 服务代表类
// 可以根据不同的服务类型，选择不同的服务去处理任务
public class BusinessDelegate
{
	private BusinessLookUp lookupService = new BusinessLookUp();
	private BusinessService businessService;
	private String serviceType;

	public void setServiceType(String serviceType)
	{
		this.serviceType = serviceType;
	}

	public void doTask()
	{
		businessService = lookupService.getBusinessService(serviceType);// 服务接口类指向具体的服务实现类
		businessService.doProcessing();
	}
}
